package com.oneraku.service.exceptions;


import com.oneraku.service.utils.R;
import com.oneraku.service.utils.ResultCode;

/**
 * 缺少参数
 * @Author: hui.ren@huberbuy.com
 * @Date: 2020/1/10 15:59
 */
public class MissParameterException extends RuntimeException {
    private final ResultCode code = ResultCode.MISSING_PARAMETER;
    /**
     *
     * @param parameterName 参数名
     */
    public MissParameterException(String parameterName) {
        super(parameterName);
    }
    public R getResult(){
        R result = new R();
        result.setCode(ResultCode.MISSING_PARAMETER.getCode());
        result.setMessage(String.format("缺少参数: %s",getMessage()));
        return result;
    }
}
